#pragma once

#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;

class StopWatch
{
public:
	StopWatch(void) {
		LARGE_INTEGER freqLi;
		QueryPerformanceFrequency(&freqLi);
		freq = double(freqLi.QuadPart)/1000.0;
	}
	~StopWatch(void){}

	void start(void) {
		QueryPerformanceCounter(&startTime);
	}
	double split(string comment){
		double splitTime;
		LARGE_INTEGER delayTime;
		QueryPerformanceCounter(&endTime);
		splitTime = double(endTime.QuadPart-startTime.QuadPart)/freq;
		cout << comment << " Time Elapsed: " << splitTime << " ms" << endl;
		QueryPerformanceCounter(&delayTime);
		startTime.QuadPart = startTime.QuadPart + delayTime.QuadPart - endTime.QuadPart;
	return splitTime;
	}
	void stop(void){
	} 
private:
	double freq;
	LARGE_INTEGER startTime, endTime;
};

